package com.java.crazy.part16.deadthread;

import com.java.crazy.base.BaseClass;

public class DeadLock extends BaseClass implements Runnable {
    ClassA classA = new ClassA();
    ClassB classB = new ClassB();

    public static void main(String[] args) {
        DeadLock deadLock = new DeadLock();
//        for (int i = 0; i < 10; i++) {
            new Thread(deadLock).start();
            deadLock.init();
            logi("_________________________________________________________________________");
//        }

    }

    private void init() {
        Thread.currentThread().setName("主线程A");
        classA.initA(classB);
        logi("进入了主线程");

    }

    @Override
    public void run() {
        Thread.currentThread().setName("副线程B");
        classB.initB(classA);
        logi("进入了副线程");
    }
}
